﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sys0a61
    {
		private string _sncode;
		private string _usercode;
		private string _nowvalue;
        private int? _nowno;
		private string _listid;
		private string _muser;
        private DateTime? _mdate;
		
        /// <summary>
        /// 编码
        /// </summary>
		public string Sncode
		{
			get { return _sncode;	 }
			set { _sncode=value;	}
		}
        /// <summary>
        /// 用户编码
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
        /// <summary>
        /// 当前值
        /// </summary>
		public string Nowvalue
		{
			get { return _nowvalue;	 }
			set { _nowvalue=value;	}
		}
        /// <summary>
        /// 当前序号值
        /// </summary>
		public int? Nowno
		{
			get { return _nowno;	 }
			set { _nowno=value;	}
		}
        /// <summary>
        /// 主键
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 维护者
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 维护时间
        /// </summary>
		public DateTime? Mdate
		{
			get { return _mdate;	 }
			set { _mdate=value;	}
		}
		
		public static List<Sys0a61> GetSys0a61ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sys0a61> list = new List<Sys0a61>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sys0a61 model = GetSys0a61ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sys0a61 GetSys0a61ByDataRow(DataRow dr)
		{
			Sys0a61 model = new Sys0a61(); //实例化Sys0a61
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("sncode")&&!(dr["sncode"] is System.DBNull))  
				model.Sncode = ( string)dr["sncode"];
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			if (dcc.Contains("nowvalue")&&!(dr["nowvalue"] is System.DBNull))  
				model.Nowvalue = ( string)dr["nowvalue"];
			if (dcc.Contains("nowno")&&!(dr["nowno"] is System.DBNull))  
				model.Nowno = ( int)dr["nowno"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("mdate")&&!(dr["mdate"] is System.DBNull))  
				model.Mdate = ( DateTime)dr["mdate"];
			
			return model;
		}
    }
}
